package com.mytomcat.catalina.container;

import com.mytomcat.catalina.valve.AccessLogValve;
import com.mytomcat.catalina.valve.StandardContextValve;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 标准上下文
 *
 * @author supu
 * @date 2019-04-19 17:02
 **/
public class StandardContext extends ContainerBase {
    private static final Logger LOGGER = LoggerFactory.getLogger(StandardContext.class);


    public StandardContext() {
        pipeline.setBasic(new StandardContextValve());
    }

    @Override
    protected void startInternal() {
        LOGGER.info("StandardContext start");

        pipeline.addValve(new AccessLogValve());

        super.startInternal();
    }

    @Override
    protected void stopInternal() {
        LOGGER.info("StandardContext stop");
    }

    @Override
    protected void destroyInternal() {
        LOGGER.info("StandardContext destroy");
    }
}
